package cn.six1943.deepchat.module.ai.agent;

import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

public interface AiConstant {

	interface HeadersTag {
		// 文档上传事件
		String ADD_FILE = "add-file";
		// 类目创建事件
		String ADD_CATEGORY= "add-category";
	}

    String API_NAME_POSTFIX = "_ai_api";

    String PROVIDER_BAILIAN = "bailian";
    String PROVIDER_BAILIAN_AUTH_KEY = "ai.bailian.default.apiKey";

    Map<String, String> MODEL = new HashMap<>() {{
        put(PROVIDER_BAILIAN, "qwen-max");
    }};

    interface agent {
        String SERVICE_BUILTIN = "builtinRagService";
        String SERVICE_EXTERNAL = "externalAgentService";
        String SERVICE_PLAINMODEL = "plainModelService";

        enum AgentType {
            PLAINMODEL(0, SERVICE_PLAINMODEL), BUILTIN(1, SERVICE_BUILTIN), EXTERNAL(2, SERVICE_EXTERNAL);

            private int code;
            private String serviceName;

            private AgentType(int code, String serviceName) {
                this.code = code;
                this.serviceName = serviceName;
            }

            public String serviceName() {
                return this.serviceName;
            }

            public static AgentType fromCode(int value) {
                return Stream.of(AgentType.values()).filter(e -> e.code == value).findFirst()
                        .orElse(null);
            }
        }
    }
}
